package com.example.app;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

public class OtrosArrayAdapter extends ArrayAdapter<OtrosDatos> {

	Context contexto;
	ArrayList<OtrosDatos> datos;

	public OtrosArrayAdapter(Context context, int textViewResourceId,
			List<OtrosDatos> objects) {
		super(context, textViewResourceId, objects);
		// TODO Auto-generated constructor stub
		contexto = context;
		datos = (ArrayList<OtrosDatos>) objects;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		LayoutInflater constructor = ((Activity) contexto).getLayoutInflater();
		View item = constructor.inflate(R.layout.adpater_pregunta8, null);

		TextView ck_dato = (TextView) item.findViewById(R.id.checkBox1);
		ck_dato.setText(datos.get(position).getDato());

		ImageView iv_imagen = (ImageView) item.findViewById(R.id.imageView1);
		iv_imagen.setImageResource(datos.get(position).getImagen());

		return item;

	}

	@Override
	public View getDropDownView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		return getView(position, convertView, parent);
	}

}
